package weapons;

import ship.ShipConstants;

import structure.SObject;
import util.LinAlg;
import util.Point;

import graphics.MaxGraphics;

import java.awt.Color;
import java.awt.Shape;
import java.awt.geom.Ellipse2D;
import java.util.*;

import animation.Explosion;

import main.Constants;
import main.Game;

public class PointDefenseDrone extends SObject {
	private double range = 200;
	private Game game;
	private int shots = 20;
	private int coolDown = 20;

	private final double SHOT_VEL = 50;
	
	public PointDefenseDrone(Game g, Point p, Point vel) {
		super(p);
		this.vel = new Point(vel);
		game = g;
	}

	@Override
	public void draw(MaxGraphics g) {
		g.setColor(Color.gray);
		g.drawOval(getX(), getY(), 10, 10);

	}

	@Override
	public void collide(SObject s) {

	}

	public Shape[] getShape() {
		Shape[] s = { new Ellipse2D.Double(getX(), getY(), 10, 10)  };
		return s;
	}
	
	public void update() {
		super.update();
		if(shots == 0) {
			game.registerObject(new Explosion(getCords(), new Point(0,0), 5, 50), (Constants.MOVE | Constants.DRAW));
			flag();
		}
	}

	@Override
	public double getRadius() {
		// TODO Auto-generated method stub
		return range;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}
}



